<extend name="Base/common"/>
<block name="header">
    <include file="Public/nav"/>
</block>
<block name="body">
    <!--模板详情-->
    <div class="container common-block templet">
        <ol class="breadcrumb">
            <li><a href="{:U('index/index')}">首页</a></li>
            <li><a href="{:U('my')}">开发者中心</a></li>
            <li class="active">控制面板</li>
        </ol>
        <include file="Admin/_info"/>
        <div class="col-md-2">

            <include file="_side"/>
        </div>


        <div class="col-md-10">
            <div class="col-md-12">
                <div id="tip"></div>
                <div class="panel panel-default">
                    <!-- Default panel contents -->

                    <div class="panel-heading">店铺设置</div>
                    <form id="form" action="__SELF__" method="post">
                        <table class="table">
                            <tbody>
                            <tr>
                                <td>店名</td>
                                <td><input class="form-control" name="title" placeholder="请输入店名，10个汉字以内" type="text"
                                           value="{$shop.title}"></td>
                            </tr>
                            <tr>
                                <td>一句话广告词</td>
                                <td><input class="form-control" name="ad" placeholder="请输入一句话广告词，店铺特色" type="text"
                                           value="{$shop.ad}"></td>
                            </tr>
                            <tr>
                                <td>logo</td>
                                <td>
                                    {:W('Common/UploadImage/render',array(array('name'=>'logo','id'=>'logo','value'=>$shop['logo'])))}
                                    <span class="text-info"> 建议180*180以上正方形图片</span></td>
                                <style>
                                    .web_uploader_picture_list img {
                                        width: 100px;
                                        height: 100px;
                                        border: 1px solid #ccc;
                                        margin-top: 5px;
                                    }
                                </style>
                            </tr>
                            <tr>
                                <td>网址</td>
                                <td><input class="form-control" name="website" placeholder="请输入企业网站" type="text"
                                           value="{$shop.website}"></td>
                            </tr>


                            <tr>
                                <td>开店说明</td>
                                <td>
                                    <div style="margin-bottom: 0 ;width: 700px">
                                        <div class="content"> 开店需通过官方审核后才会出现在店铺列表并允许使用店铺功能。<br/>原则上不会通过没有商品的店铺开店申请，所以请在提交开店申请之前先上架商品，商品越多审核速度越快。
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>店铺状态</td>
                                <td>
                                    <div style="margin-bottom: 0 ;width: 700px">
                                        <div class="content">
                                            <switch name="shop.status">
                                                <case value="0">
                                                    <span class="text-muted"><strong>尚未提交审核</strong></span> <span
                                                        class="text-danger">（请尽快提交申请）</span>
                                                </case>
                                                <case value="1">
                                                    <span class="text-success">运营中（ {$shop.evaluation|default='暂未评定'}）</span>
                                                </case>
                                                <case value="2">
                                                    <span class="text-warning">正在审核中，请耐心等待</span>
                                                </case>
                                                <case value="3">
                                                    <span class="text-danger">开店申请被拒绝（建议： {$shop.suggestion|default='暂无修改意见'}）</span>
                                                </case>
                                            </switch>


                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>
                                    <div class="col-md-6">
                                        <button type="button" data-loading-text="发送请求中" id="btn_submit"
                                                class="btn-block btn btn-primary">保存设置
                                        </button>
                                    </div>
                                    <div class="col-md-6">
                                        <if condition="in_array($shop['status'],array('0','3'))">
                                            <button type="button" data-loading-text="发送请求中" id="btn_submit_verify"
                                                    class="btn-block btn btn-success">确认无误，提交开店申请
                                            </button>
                                        </if>
                                    </div>

                                </td>
                            </tr>
                            </tbody>
                            <script>
                                $(function () {

                                    $('#btn_submit').click(function () {
                                        var d = $('#form').serialize();
                                        toast.showLoading();
                                        $.post($('#form').attr('action'), d, function (msg) {
                                            toast.hideLoading();
                                            if (msg.status) {
                                                $('#tip').html(msg.info);
                                                setTimeout('location.reload()',1500);
                                            } else {
                                                $('#tip').html( msg.info);
                                            }
                                        });
                                    });
                                    $('#btn_submit_verify').click(function () {
                                        var d = $('#form').serialize();
                                        toast.showLoading();
                                        $.post(U('Appstore/Admin/submitVerify'),d, function (msg) {
                                            toast.hideLoading();
                                            if (msg.status) {
                                                $('#tip').html(msg.info);
                                                setTimeout('location.reload()',1500);
                                            } else {
                                                $('#tip').html(msg.info);
                                            }
                                        })
                                    })
                                })
                            </script>
                        </table>
                    </form>
                </div>
            </div>

        </div>
    </div>
    <style>
        .cover {
            width: 60px;
            height: 60px;
            min-width: 60px;
        }
    </style>
</block>
